package com.danjinwulian.device.service.impl;

import java.util.List;

import com.danjinwulian.common.core.domain.entity.IotDeviceLog;
import com.danjinwulian.common.utils.DateUtils;
import com.danjinwulian.device.mapper.IotDeviceLogMapper;
import com.danjinwulian.device.service.IIotDeviceLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备日志Service业务层处理
 * 
 * @author ken.h
 * @date 2023-03-20
 */
@Service
public class IotDeviceLogServiceImpl implements IIotDeviceLogService
{
    @Autowired
    private IotDeviceLogMapper iotDeviceLogMapper;

    /**
     * 查询设备日志
     * 
     * @param deviceLogId 设备日志主键
     * @return 设备日志
     */
    @Override
    public IotDeviceLog selectIotDeviceLogByDeviceLogId(Long deviceLogId)
    {
        return iotDeviceLogMapper.selectIotDeviceLogByDeviceLogId(deviceLogId);
    }

    /**
     * 查询设备日志列表
     * 
     * @param iotDeviceLog 设备日志
     * @return 设备日志
     */
    @Override
    public List<IotDeviceLog> selectIotDeviceLogList(IotDeviceLog iotDeviceLog)
    {
        return iotDeviceLogMapper.selectIotDeviceLogList(iotDeviceLog);
    }

    /**
     * 新增设备日志
     * 
     * @param iotDeviceLog 设备日志
     * @return 结果
     */
    @Override
    public int insertIotDeviceLog(IotDeviceLog iotDeviceLog)
    {
        iotDeviceLog.setCreateTime(DateUtils.getNowDate());
        return iotDeviceLogMapper.insertIotDeviceLog(iotDeviceLog);
    }

    /**
     * 修改设备日志
     * 
     * @param iotDeviceLog 设备日志
     * @return 结果
     */
    @Override
    public int updateIotDeviceLog(IotDeviceLog iotDeviceLog)
    {
        return iotDeviceLogMapper.updateIotDeviceLog(iotDeviceLog);
    }

    /**
     * 批量删除设备日志
     * 
     * @param deviceLogIds 需要删除的设备日志主键
     * @return 结果
     */
    @Override
    public int deleteIotDeviceLogByDeviceLogIds(Long[] deviceLogIds)
    {
        return iotDeviceLogMapper.deleteIotDeviceLogByDeviceLogIds(deviceLogIds);
    }

    /**
     * 删除设备日志信息
     * 
     * @param deviceLogId 设备日志主键
     * @return 结果
     */
    @Override
    public int deleteIotDeviceLogByDeviceLogId(Long deviceLogId)
    {
        return iotDeviceLogMapper.deleteIotDeviceLogByDeviceLogId(deviceLogId);
    }
}
